﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" CodeFile="BankAccounts.aspx.cs" Inherits="Admin_BankAccounts" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">

<br/>
    <asp:HyperLink ID="AdminLink" runat="server" NavigateUrl="../Admin/Admin.aspx">Администраторская панель</asp:HyperLink>
&nbsp; <span class="Apple-style-span" 
        style="font: 13px/normal &quot;Helvetica Neue&quot;, &quot;Lucida Grande&quot;, &quot;Segoe UI&quot;, Arial, Helvetica, Verdana, sans-serif; color: rgb(105, 105, 105); text-transform: none; text-indent: 0px; letter-spacing: normal; word-spacing: 0px; float: none; display: inline !important; white-space: normal; orphans: 2; widows: 2; background-color: rgb(255, 255, 255); -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">
   
    <b>&nbsp;→ <asp:Label ID="BankAccountsLabel" runat="server" Text="Счета банка" ForeColor="black"></asp:Label></b>
    <br/>
    <br />
    
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
        DataKeyNames="Номер счёта" DataSourceID="SqlDataSourceBankAccounts" 
        onselectedindexchanged="GridView1_SelectedIndexChanged" 
        onrowdatabound="GridView1_RowDataBound">
        <Columns>
            <asp:CommandField SelectText="Сбросить" ShowSelectButton="True" />
            <asp:BoundField DataField="Номер счёта" HeaderText="Номер счёта" 
                ReadOnly="True" SortExpression="Номер счёта" />
            <asp:BoundField DataField="Сумма" HeaderText="Сумма" SortExpression="Сумма" />
            <asp:BoundField DataField="Валюта" HeaderText="Валюта" 
                SortExpression="Валюта" />
            <asp:TemplateField>
            <ItemTemplate>
                <asp:LinkButton ID="AddLink" runat="server" OnClick="ClickAddMoney">Пополнить</asp:LinkButton>
            </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EmptyDataTemplate>
            Счетов нет.
        </EmptyDataTemplate>
    </asp:GridView>

    <asp:SqlDataSource ID="SqlDataSourceBankAccounts" runat="server" 
        ConnectionString="<%$ ConnectionStrings:DatabaseConnectionString %>" 
        SelectCommand="SELECT BankAccountBank.BankAccountId AS [Номер счёта], BankAccount.Amount AS Сумма, Currency.Name AS Валюта FROM Currency INNER JOIN BankAccount ON Currency.CurrencyID = BankAccount.CurrencyId INNER JOIN BankAccountBank ON BankAccount.BankAccountId = BankAccountBank.BankAccountId">
    </asp:SqlDataSource>

    <br />
    <asp:Button ID="CreateAccountButton" runat="server" Text="Открыть счёт" 
        onclick="CreateAccountButton_Click" />

</asp:Content>

